'use strict';
module.exports = {
	/**
	 * 查询推广
	 * @url client/popularize/pub/getList 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------
		let { page, pageSize } = data;
		
		let dbName = "db-popularize"
		
		res["data"] = await vk.baseDao.selects({
			dbName,
			whereJson: {
				status: 1
			},
			getMain: true,
			pageIndex: page || 1,
			pageSize: pageSize || 10,
			sort: [{name: "sort", type: "desc"}, {name: "_add_time", type: "desc"}]
		})
		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
